class Solution:
    def isThree(self, n: int) -> bool:
        num = 0
        for i in range(1, n + 1):
            if n % i == 0:
                num += 1
                if num > 3:
                    return False
        return num == 3


if __name__ == "__main__":
    print(Solution().isThree(2))  # False
    print(Solution().isThree(4))  # True
